﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ue.Infrastructure;

namespace Ue.Qcdz.Repositories
{
    public abstract class SqlServerRepository<TEntity> : Ue.Infrastructure.RepositoryFramework.Repository.SqlServerRepositoryBase<TEntity>
        where TEntity : Ue.Infrastructure.DomainBase.IEntity
    {
        public SqlServerRepository()
            : this(null) { }

        public SqlServerRepository(IUnitOfWork uniteOfWork)
            : base(uniteOfWork, SqlServerDriver.Instance) { }

        protected override string GetKeyFieldName()
        {
            return FieldNamesBase.EntityKey;
        }

        protected override string GetOrderBy()
        {
            return string.Format("{0} desc", FieldNamesBase.EntityKey);
        }
    }
}
